package com.hzjq.encrypt.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hzjq.encrypt.R
import com.hzjq.encrypt.bean.Lg

class LgAdapter : BaseQuickAdapter<Lg,BaseViewHolder> {

    constructor(data: MutableList<Lg>?) : super(R.layout.item_lg_layout, data)

    override fun convert(holder: BaseViewHolder, item: Lg) {
        holder.setText(R.id.lgItemUidText,"雷管编号:"+item.uid)
        holder.setText(R.id.lgItemYxqText,"有效期:"+item.yxq)
        holder.setText(R.id.lgItemGzmText,"工作码:"+item.gzm)
        holder.setText(R.id.lgItemFbhText,"发编号:"+item.fbh)
        holder.setText(R.id.lgItemCwxxText,"错误信息:"+item.gzmcwxx)
        holder.getView<TextView>(R.id.lgItemDeleteText)
            .setOnClickListener {
                getOnItemChildClickListener()?.onItemChildClick(this,it,holder.adapterPosition)
            }
        holder.getView<TextView>(R.id.lgItemEditorText)
            .setOnClickListener {
                getOnItemChildClickListener()?.onItemChildClick(this,it,holder.adapterPosition)
            }
        item.position = holder.adapterPosition
    }
}